package xinxin.com.FlyweightPattern;

import xinxin.com.FlyweightPattern.Factory.WebSiteFactory;
import xinxin.com.FlyweightPattern.WebSite.WebSite;

/**
 * @author ：史鑫鑫
 * @date ：Created in 2019/4/2 21:18
 */
public class FlyweightPattern {
    public static void main(String[] args) {
        WebSiteFactory factory = new WebSiteFactory();
        WebSite fx = factory.GetWebSiteCategory("产品展示");
        fx.Use();

        WebSite fy = factory.GetWebSiteCategory("产品展示");
        fy.Use();

        WebSite fz = factory.GetWebSiteCategory("产品展示");
        fz.Use();

        WebSite fl = factory.GetWebSiteCategory("博客");
        fl.Use();

        WebSite fm = factory.GetWebSiteCategory("博客");
        fm.Use();

        WebSite fn = factory.GetWebSiteCategory("博客");
        fn.Use();

        System.out.println("网站分类总数" + factory.GetWebSiteCount());
    }
}
